/*
 * ListenerNuevoCd.java
 *
 * Created on 28 de octubre de 2005, 1:22
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package fmap.gui.actionListener;

import java.awt.event.ActionEvent;
import javax.swing.JButton;
import fmap.DatosCompartidos;
import fmap.gui.JFrameIcons;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;

/**
 *
 * @author javi
 */
public class ListenerJFrameIcons implements ActionListener
{
    JFrameIcons jFrameIcons;
    
    /** Creates a new instance of ListenerNuevoCd */
    public ListenerJFrameIcons( JFrameIcons _jFrameIcons)
    {
        jFrameIcons = _jFrameIcons;
    }
    
    
    
    
    public void actionPerformed(ActionEvent ae)
    {
        JButton jb = (JButton)ae.getSource();

        if( jFrameIcons.getType ().equals ("mapF")) 
        {
            DatosCompartidos.getJFrameNewMapF ().setIcon ( jb.getName () );
        }
        else if( jFrameIcons.getType ().equals ("mapFPanelRight")) 
        {
            DatosCompartidos.getPanelRight ().setIcon2 (jb.getName () );
        }
        else
        {
            DatosCompartidos.getPanelRight ().setIcon (jb.getName () );
        }
        
        jFrameIcons.setVisible ( false );
    }

}
